﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Ajeelee.Core.Database;
using Ajeelee.Core.Utils;
using FxhjpgWeb.Business;
using FxhjpgWeb.Model;
using FxhjpgWeb.WebSite.Code;
using System.Collections;

namespace FxhjpgWeb.WebSite.pfdn
{
    public partial class products : PageBase
    {
        protected int id;
        protected string cname = "帕菲迪尼";
        Hashtable table = new Hashtable();
        protected IList<PhotoImgs> photoImgsList = new List<PhotoImgs>();
        IPhotoImgsBusiness photoBll = new PhotoImgsBusinessFactory().CreatePhotoImgsBusiness();
        protected PageStructure ps = new PageStructure() { CurrPage = 1, PageSize = 40 };

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            // 获取参数
            id = QueryParamInt32("id");
            try
            {
                if (id > 0)
                {
                    switch (id)
                    {
                        case 2:
                            cname = "帕菲迪尼";
                            break;
                        case 3:
                            cname = "玉龙轩";
                            break;
                        case 4:
                            cname = "盛世天骄";
                            break;
                    }

                    table.Add(PhotoImgsHash.CId, id);
                }
                else
                {
                    table.Add(PhotoImgsHash.CustomWhere, "P_CId in (2,3,4)");
                }
                table.Add(PhotoImgsHash.OrderField, "Sort,P_Id");
                table.Add(PhotoImgsHash.OrderDirection, "asc");
                photoImgsList = photoBll.GetAllPhotoImgsByPage(table, ps);
            }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}